# test script for QUTest unit testing harness
# see https://www.state-machine.com/qtools/qutest.html/qutest.html

# preamble...
def on_reset():
    expect_pause()
    continue_test()
    expect_run()

# tests...
test("tick")
glb_filter(GRP_ALL)
current_obj(OBJ_TE, "Philo_inst[2].timeEvt")
tick()
expect("           Tick<0>  Ctr=*")
expect("           TE0-ADis Obj=Philo_inst[2].timeEvt,AO=Philo_inst[2]")
expect("@timestamp TE0-Post Obj=Philo_inst[2].timeEvt,Sig=TIMEOUT_SIG,AO=Philo_inst[2]")
expect("@timestamp AO-Post  Sdr=QS_RX,Obj=Philo_inst[2],Evt<Sig=TIMEOUT_SIG,Pool=0,Ref=0>,*")
expect("@timestamp AO-GetL  Obj=Philo_inst[2],Evt<Sig=TIMEOUT_SIG,Pool=0,Ref=0>")
expect("@timestamp Disp===> Obj=Philo_inst[2],Sig=TIMEOUT_SIG,State=Philo_thinking")
expect("@timestamp TE0-DisA Obj=Philo_inst[2].timeEvt,AO=Philo_inst[2]")
expect("===RTC===> St-Exit  Obj=Philo_inst[2],State=Philo_thinking")
expect("@timestamp MP-Get   Obj=EvtPool1,*")
expect("@timestamp QF-New   Sig=HUNGRY_SIG,*")
expect("@timestamp AO-Post  Sdr=Philo_inst[2],Obj=Table_inst,Evt<Sig=HUNGRY_SIG,Pool=1,Ref=1>,*")
expect("@timestamp QUTEST_ON_POST HUNGRY_SIG,Obj=Table_inst 2")
expect("===RTC===> St-Entry Obj=Philo_inst[2],State=Philo_hungry")
expect("@timestamp ===>Tran Obj=Philo_inst[2],Sig=TIMEOUT_SIG,State=Philo_thinking->Philo_hungry")
expect("@timestamp AO-GetL  Obj=Table_inst,Evt<Sig=HUNGRY_SIG,Pool=1,Ref=1>")
expect("@timestamp Disp===> Obj=Table_inst,Sig=HUNGRY_SIG,State=Table_serving")
expect("@timestamp BSP_CALL BSP_displayPhilStat 2 hungry  ")
expect("@timestamp MP-Get   Obj=EvtPool1,*")
expect("@timestamp QF-New   Sig=EAT_SIG,*")
expect("@timestamp QF-Pub   Sdr=Table_inst,Evt<Sig=EAT_SIG,Pool=1,Ref=0>")
expect("@timestamp AO-Post  Sdr=Table_inst,Obj=Philo_inst[4],Evt<Sig=EAT_SIG,Pool=1,Ref=2>,*")
expect("@timestamp QUTEST_ON_POST EAT_SIG,Obj=Philo_inst[4] 2")
expect("@timestamp AO-Post  Sdr=Table_inst,Obj=Philo_inst[3],Evt<Sig=EAT_SIG,Pool=1,Ref=3>,*")
expect("@timestamp QUTEST_ON_POST EAT_SIG,Obj=Philo_inst[3] 2")
expect("@timestamp AO-Post  Sdr=Table_inst,Obj=Philo_inst[2],Evt<Sig=EAT_SIG,Pool=1,Ref=4>,*")
expect("@timestamp QUTEST_ON_POST EAT_SIG,Obj=Philo_inst[2] 2")
expect("@timestamp AO-Post  Sdr=Table_inst,Obj=Philo_inst[1],Evt<Sig=EAT_SIG,Pool=1,Ref=5>,*")
expect("@timestamp QUTEST_ON_POST EAT_SIG,Obj=Philo_inst[1] 2")
expect("@timestamp AO-Post  Sdr=Table_inst,Obj=Philo_inst[0],Evt<Sig=EAT_SIG,Pool=1,Ref=6>,*")
expect("@timestamp QUTEST_ON_POST EAT_SIG,Obj=Philo_inst[0] 2")
expect("@timestamp QF-gcA   Evt<Sig=EAT_SIG,Pool=1,*")
expect("@timestamp BSP_CALL BSP_displayPhilStat 2 eating  ")
expect("@timestamp =>Intern Obj=Table_inst,Sig=HUNGRY_SIG,State=Table_serving")
expect("@timestamp QF-gc    Evt<Sig=HUNGRY_SIG,Pool=1,Ref=1>")
expect("@timestamp MP-Put   Obj=EvtPool1,*")
expect("@timestamp AO-GetL  Obj=Philo_inst[4],Evt<Sig=EAT_SIG,Pool=1,*")
expect("@timestamp Disp===> Obj=Philo_inst[4],Sig=EAT_SIG,State=Philo_thinking")
expect("@timestamp =>Intern Obj=Philo_inst[4],Sig=EAT_SIG,State=Philo_thinking")
expect("@timestamp QF-gcA   Evt<Sig=EAT_SIG,Pool=1,*")
expect("@timestamp AO-GetL  Obj=Philo_inst[3],Evt<Sig=EAT_SIG,Pool=1,*")
expect("@timestamp Disp===> Obj=Philo_inst[3],Sig=EAT_SIG,State=Philo_thinking")
expect("@timestamp =>Intern Obj=Philo_inst[3],Sig=EAT_SIG,State=Philo_thinking")
expect("@timestamp QF-gcA   Evt<Sig=EAT_SIG,Pool=1,*")
expect("@timestamp AO-GetL  Obj=Philo_inst[2],Evt<Sig=EAT_SIG,Pool=1,*")
expect("@timestamp Disp===> Obj=Philo_inst[2],Sig=EAT_SIG,State=Philo_hungry")
expect("@timestamp BSP_CALL BSP_random *")
expect("@timestamp TE0-Arm  Obj=Philo_inst[2].timeEvt,AO=Philo_inst[2],Tim=*,Int=0")
expect("===RTC===> St-Entry Obj=Philo_inst[2],State=Philo_eating")
expect("@timestamp ===>Tran Obj=Philo_inst[2],Sig=EAT_SIG,State=Philo_hungry->Philo_eating")
expect("@timestamp QF-gcA   Evt<Sig=EAT_SIG,Pool=1,*")
expect("@timestamp AO-GetL  Obj=Philo_inst[1],Evt<Sig=EAT_SIG,Pool=1,*")
expect("@timestamp Disp===> Obj=Philo_inst[1],Sig=EAT_SIG,State=Philo_thinking")
expect("@timestamp =>Intern Obj=Philo_inst[1],Sig=EAT_SIG,State=Philo_thinking")
expect("@timestamp QF-gcA   Evt<Sig=EAT_SIG,Pool=1,*")
expect("@timestamp AO-GetL  Obj=Philo_inst[0],Evt<Sig=EAT_SIG,Pool=1,*")
expect("@timestamp Disp===> Obj=Philo_inst[0],Sig=EAT_SIG,State=Philo_thinking")
expect("@timestamp =>Intern Obj=Philo_inst[0],Sig=EAT_SIG,State=Philo_thinking")
expect("@timestamp QF-gc    Evt<Sig=EAT_SIG,Pool=1,*")
expect("@timestamp MP-Put   Obj=EvtPool1,*")
expect("@timestamp Trg-Done QS_RX_TICK")

